<?php
/**
 * Project: AIGC
 * Author: moufer <moufer@163.com>
 * Date: 2024/8/30 23:56
 */

namespace module\user\controller;

use module\user\library\UserController;
use module\user\model\ScoreLog;
use mof\ApiResponse;
use mof\Searcher;
use think\response\Json;

class Score extends UserController
{
    public function logs(): Json
    {
        $searcher = new Searcher();
        $paginate = $searcher->model(ScoreLog::class)
            ->params(['user_id' => $this->auth->getId()])
            ->order(['id' => 'desc'])
            ->pageSize(10)
            ->limitTotal(100) //数量最多只显示200条
            ->paginate();

        return ApiResponse::success($paginate);
    }
}